<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>浏览回复</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="<< url_for('static', filename='layui/css/layui.css',t='1483944306685') >>" media="all">
  <link rel="stylesheet" href="<< url_for('static', filename='layui/css/notice.css',t='879425') >>" media="all">
</head>
<body>
  <div class="layui-form" lay-filter="layuiadmin-form-tags" id="layuiadmin-app-form-tags" style="padding-top: 30px; text-align: center;">
    <div class="layui-form-item">
      <label class="layui-form-label">回复内容</label>
      <div class="layui-input-block">
        << form.replyContent >>
        << form.csrf_token >>
      </div>
       <div class="layui-form-item layui-hide">
      <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit" value="确认">
    </div>
    </div>
  </div>
 <script src="/static/layui/layui.all.js?t=1483944306685" charset="utf-8" type="text/javascript"></script>
<script>
    var $ = layui.jquery, i = layui.view,
            element = layui.element,
            layer = layui.layer, table = layui.table, form = layui.form;
    form.on('submit(layuiadmin-app-form-edit)', function(data){
      var field = data.field; //获取提交的字段
      var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
      //提交 Ajax 成功后，关闭当前弹层并重载表格
      $.ajax({
          url:"<< url_for('admin.MessageToReply',Id=Message.Id) >>",
          type:'post',
          data:field,
          dataType: 'json',
          success: function (returnData) {
                if (returnData.status == 1) {
                    layer.msg('发布成功');
                    parent.layui.table.reload('LAY-app-content-comm'); //重载表格
                    parent.layer.close(index); //再执行关闭
                }
                else {
                    layer.msg(returnData.info)
                }
           }
      });
    });
  </script>
</body>
</html>